<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Models\Exhibition;

class ExhibitionController extends Controller
{
    
	public function index(Request $request,$type)
    {
    	
    	$where     = [];
        $type_name = '';
    	if($type) {
    		$where['type'] = (int)$type;
            $type_name = (int)$request->type==1?'正在展览':'展览预告';
    	}
    	$list = Exhibition::where($where)->paginate(5);
    	return view('painting.exhibition-list',compact('list','type','type_name'));
    }

    public function show($id)
    {
    	$data = Exhibition::find($id);
    	return view('painting.exhibition',compact('data'));
    }
}
